class Merger:
    def __init__(self,f1_path,f2_path):
        self.f1_path = f1_path
        self.f2_path = f2_path

    def _merge(self):
        # 读取f1的内容
        with open(self.f1_path, 'r') as f1:
            self.content_f1 = f1.read()

        # 读取f2的内容，删除第一行后拼接剩余部分
        with open(self.f2_path, 'r') as f2:
            lines = f2.readlines()
            self.content_f2 = ''.join(lines[1:])  # 跳过第一行

        # 将处理后的内容合并并写回f1
        with open(f'{self.f1_path}', 'w') as f1:
            f1.write(self.content_f1 + self.content_f2)

if __name__ == '__main__':
    f1_path = r"txtsave/2025-04-29-17-31-47.tdms.txt"
    f2_path = r"txtsave/2025-04-29-17-33-47.tdms.txt"
    my_merger = Merger(f1_path,f2_path)
    my_merger._merge()